<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
   <button id="btn">提交</button>
   <script>
       $("#btn").click(function (){ 
           $.ajax({
            type:"GET",//方式 
            url:"/userInfo",//接口地址
            cache:false,//是否读取缓存
            data:{
                userId:"001"
            },//数据
            dataType:"json",//接受的类型
            timeout:10000,//设置超时事件
            success(data){//成功回调函数
                console.log("success",data);
            }
        
        })
       })
    </script>
</body>
</html>